package com.amigo.online.common.util;

import javax.servlet.http.HttpServletRequest;

import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;

public class ServletUtils {

	/**
     * 获取当期请求对象
     * @return
     */
    public static HttpServletRequest getRequest() {

        //RequestAttributes requestAttributes1 = RequestContextHolder.currentRequestAttributes();
        //RequestAttributes requestAttributes2 = RequestContextHolder.getRequestAttributes();


        return ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
    }
}
